home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / bbsutil / bsrc_250.zip / BINK_ASM.ASM < prev    next >
Assembly Source File  |  1991-09-15  |  10KB  |  468 lines

  1. ;--------------------------------------------------------------------------;
  2. ;                                                                          ;
  3. ;                                                                          ;
  4. ;      ------------         Bit-Bucket Software, Co.                       ;
  5. ;      \ 10001101 /         Writers and Distributors of                    ;
  6. ;       \ 011110 /          Freely Available<tm> Software.                 ;
  7. ;        \ 1011 /                                                          ;
  8. ;         ------                                                           ;
  9. ;                                                                          ;
  10. ;  (C) Copyright 1987-91, Bit Bucket Software Co., a Delaware Corporation. ;
  11. ;                                                                          ;
  12. ;                                                                          ;
  13. ;                   Assembly routines for BinkleyTerm                      ;
  14. ;                                                                          ;
  15. ;                                                                          ;
  16. ;    For complete  details  of the licensing restrictions, please refer    ;
  17. ;    to the License  agreement,  which  is published in its entirety in    ;
  18. ;    the MAKEFILE and BT.C, and also contained in the file LICENSE.250.    ;
  19. ;                                                                          ;
  20. ;    USE  OF THIS FILE IS SUBJECT TO THE  RESTRICTIONS CONTAINED IN THE    ;
  21. ;    BINKLEYTERM  LICENSING  AGREEMENT.  IF YOU DO NOT FIND THE TEXT OF    ;
  22. ;    THIS  AGREEMENT IN ANY OF THE  AFOREMENTIONED FILES,  OR IF YOU DO    ;
  23. ;    NOT HAVE THESE FILES,  YOU  SHOULD  IMMEDIATELY CONTACT BIT BUCKET    ;
  24. ;    SOFTWARE CO.  AT ONE OF THE  ADDRESSES  LISTED BELOW.  IN NO EVENT    ;
  25. ;    SHOULD YOU  PROCEED TO USE THIS FILE  WITHOUT HAVING  ACCEPTED THE    ;
  26. ;    TERMS  OF  THE  BINKLEYTERM  LICENSING  AGREEMENT,  OR  SUCH OTHER    ;
  27. ;    AGREEMENT AS YOU ARE ABLE TO REACH WITH BIT BUCKET SOFTWARE, CO.      ;
  28. ;                                                                          ;
  29. ;                                                                          ;
  30. ; You can contact Bit Bucket Software Co. at any one of the following      ;
  31. ; addresses:                                                               ;
  32. ;                                                                          ;
  33. ; Bit Bucket Software Co.        FidoNet  1:104/501, 1:343/491             ;
  34. ; P.O. Box 460398                AlterNet 7:491/0                          ;
  35. ; Aurora, CO 80046               BBS-Net  86:2030/1                        ;
  36. ;                                Internet f491.n343.z1.fidonet.org         ;
  37. ;                                                                          ;
  38. ; Please feel free to contact us at any time to share your comments about  ;
  39. ; our software and/or licensing policies.                                  ;
  40. ;--------------------------------------------------------------------------;
  41.  
  42. .xlist
  43.         page    64,132
  44.         
  45.         title   Bink_Asm
  46.         subttl  by Bob Hartman
  47.         
  48.         .sall
  49. .list
  50.  
  51. ;
  52. ;;;;;;;;;;;;;;;;;;;;;;;;;;;
  53. ;;                       ;;  
  54. ;;     DATA SEGMENT      ;;
  55. ;;                       ;;
  56. ;;;;;;;;;;;;;;;;;;;;;;;;;;;
  57. ;
  58. ;
  59. _DATA    SEGMENT  WORD PUBLIC 'DATA'
  60. _DATA    ENDS
  61. ;CONST    SEGMENT  WORD PUBLIC 'CONST'
  62. ;CONST    ENDS
  63. _BSS    SEGMENT  WORD PUBLIC 'BSS'
  64. _BSS    ENDS
  65. ;DGROUP    GROUP    CONST, _BSS, _DATA
  66. DGROUP    GROUP    _BSS, _DATA
  67. ;
  68. ;
  69. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  70. ;
  71. ;
  72. ;
  73. ;
  74. ;;;;;;;;;;;;;;;;;;;;;;;;;;;
  75. ;;                       ;;  
  76. ;;     CODE SEGMENT      ;;
  77. ;;                       ;;
  78. ;;;;;;;;;;;;;;;;;;;;;;;;;;;
  79. ;
  80. ;
  81. BINK_ASM_TEXT    SEGMENT  WORD PUBLIC 'CODE'
  82.  
  83.     ASSUME  CS: BINK_ASM_TEXT, DS: DGROUP, SS: DGROUP
  84.  
  85.                                 
  86. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  87.  
  88. ;cProc   real_flush,<PUBLIC>
  89. ;        parmW fhandle
  90. ;
  91. ;cBegin
  92.  
  93.     public    _real_flush
  94. _real_flush proc far
  95.     push    bp
  96.     mov    bp,sp
  97.  
  98.         mov     ah,45h
  99. ;       mov     bx,fhandle
  100.     mov    bx, word ptr [bp+6]
  101.  
  102.         int     21h
  103.         jc      rferr
  104.         mov     bx,ax
  105.         mov     ah,3eh
  106.         int     21h
  107.         xor     ax,ax
  108.         jmp     rfout
  109.  
  110. rferr:
  111.         mov     ax,1
  112.  
  113. rfout:
  114.  
  115. ;cEnd
  116.     pop    bp
  117.     ret
  118. _real_flush endp
  119.  
  120.  
  121.  
  122. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  123.  
  124. ;cProc   dv_get_version,<PUBLIC>
  125. ;
  126. ;cBegin
  127.  
  128.     public    _dv_get_version
  129. _dv_get_version proc far
  130.     push    bp
  131.  
  132.         mov     cx,4445h
  133.         mov     dx,5351h
  134.         mov     ax,2b01h
  135.         int     21h
  136.         cmp     al,0ffh
  137.         je      no_dv
  138.         mov     ax,bx
  139.         jmp     short got_dv
  140.  
  141. no_dv:
  142.         xor     ax,ax
  143.  
  144. got_dv:
  145.  
  146. ;cEnd
  147.     pop    bp
  148.     ret
  149. _dv_get_version endp
  150.  
  151.  
  152.  
  153. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  154.  
  155. ;cProc   windows_active,<PUBLIC>
  156. ;
  157. ;cBegin
  158.  
  159.     public    _windows_active
  160. _windows_active proc far
  161.     push    bp
  162.  
  163.     push    es            ; Save old ES
  164.     push    bx            ; Save old BX
  165.     mov    ax,352Fh        ; We are about to clobber them
  166.     int    21h            ; DOS get vector for 2Fh
  167.  
  168.     mov    ax,es            ; ES:BX = vector
  169.     or    ax,bx            ; So let's see if there is one
  170.  
  171.     jz    got_windows        ; Nope, so return the zero
  172.  
  173. ; Int 2f will work. So let's do it.
  174.  
  175.     mov    ax, 1600h         ; test for Windows
  176.     int    2fh            ; Go do the test
  177.     and    ax, 007fh        ; Mask off bit so 80 is same as 0
  178.  
  179. ; Result is now zero if not windows and nonzero if windows. Good enough.
  180.  
  181. got_windows:
  182.  
  183.     pop    bx            ; Restore old bx and es
  184.     pop    es
  185.  
  186. ;cEnd
  187.     pop    bp
  188.     ret
  189. _windows_active endp
  190.  
  191.  
  192. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  193.  
  194. ;cProc   mos_active,<PUBLIC>
  195. ;
  196. ;cBegin
  197.  
  198.     public    _mos_active
  199. _mos_active proc far
  200.     push    bp
  201.  
  202.         mov     ah,30h
  203.         int     21h
  204.         push    ax       ;save it
  205.         mov     ax,3000h
  206.         mov     bx,ax
  207.         mov     cx,ax
  208.         mov     dx,ax
  209.         int     21h
  210.         pop     bx
  211.         cmp     ax,bx
  212.         jne     got_mos
  213.         xor     ax,ax
  214.  
  215. got_mos:
  216.  
  217. ;cEnd
  218.     pop    bp
  219.     ret
  220. _mos_active endp
  221.  
  222.  
  223. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  224.  
  225. ;cProc   ddos_active,<PUBLIC>
  226. ;
  227. ;cBegin
  228.     public    _ddos_active
  229. _ddos_active proc far
  230.     push    bp
  231.  
  232.         mov     ah,0e4h
  233.         int     21h
  234.         cmp     al,1
  235.         je      got_ddos
  236.         cmp     al,2
  237.         je      got_ddos
  238.         xor     ax,ax
  239.  
  240. got_ddos:
  241.  
  242. ;cEnd
  243.     pop    bp
  244.     ret
  245. _ddos_active endp
  246.  
  247.  
  248. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  249.  
  250. ;cProc   tv_get_version,<PUBLIC>
  251. ;
  252. ;cBegin
  253.  
  254.     public    _tv_get_version
  255. _tv_get_version proc far
  256.     push    bp
  257.  
  258.         mov     ax,1022h
  259.         mov     bx,0
  260.         int     15h
  261.         cmp     bx,0
  262.         je      no_tv
  263.         mov     ax,bx
  264.         jmp     short got_tv
  265.  
  266. no_tv:
  267.         xor     ax,ax
  268.  
  269. got_tv:
  270.  
  271. ;cEnd
  272.     pop    bp
  273.     ret
  274. _tv_get_version endp
  275.  
  276.  
  277.  
  278. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  279.  
  280. ;cProc   ml_active,<PUBLIC>,<ds>
  281. ;cBegin 
  282.  
  283.     public    _ml_active
  284. _ml_active proc far
  285.     push    bp
  286.     push    ds
  287.  
  288.         sub     ax,ax
  289.         mov     ds,ax 
  290.         mov     ax,ds:[01feh] 
  291.         cmp     ax,0000 
  292.         je      no_ml 
  293.         jmp     short got_ml 
  294.  
  295. no_ml: 
  296.         xor     ax,ax 
  297.  
  298. got_ml: 
  299.  
  300. ;cEnd 
  301.     pop    ds
  302.     pop    bp
  303.     ret
  304. _ml_active endp
  305.  
  306.  
  307.  
  308. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  309.  
  310. ;cProc   ml_pause,<PUBLIC> 
  311. ;cBegin 
  312.  
  313.     public    _ml_pause
  314. _ml_pause proc far
  315.     push    bp
  316.  
  317.         mov     ah,02h 
  318.         mov     al,00h 
  319.         int     7fh 
  320.  
  321. ;cEnd 
  322.     pop    bp
  323.     ret
  324. _ml_pause endp
  325.  
  326.  
  327.  
  328. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  329.  
  330. ;cProc   dv_pause,<PUBLIC>
  331. ;
  332. ;cBegin
  333.  
  334.     public    _dv_pause
  335. _dv_pause proc far
  336.     push    bp
  337.  
  338.         mov